package com.xcm.service;

import com.alibaba.fastjson.JSONObject;
import com.xcm.exception.ServiceException;
import com.xcm.model.TbDeviceModel;
import com.xcm.model.dto.DeviceModelDTO;
import com.xcm.model.vo.DeviceModelListVO;
import com.xcm.page.PageInfo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 终端型号Service
 */
public interface DeviceModelService {
	/**
	 * 获取终端型号列表
	 *
	 * @return List<DeviceModelDTO>
	 */
	List<DeviceModelDTO> listDeviceModels();

	/**
	 * 获取终端型号分页列表
	 *
	 * @param pageNum  当前页
	 * @param pageSize 每页显示多少条
	 * @return List<TbDeviceModel>
	 */
	PageInfo<DeviceModelListVO> listDeviceModelByPage(Integer pageNum, Integer pageSize);

	/**
	 * 保存终端型号
	 *
     * @param deviceModel TbDeviceModel
     * @param user
     * @param request
     */
	void saveDeviceModel(TbDeviceModel deviceModel, JSONObject user, HttpServletRequest request) throws ServiceException;

	/**
	 * 修改终端型号
	 *
     * @param deviceModel TbDeviceModel
     * @param user
     * @param request
     */
	void updateDeviceModel(TbDeviceModel deviceModel, JSONObject user, HttpServletRequest request) throws ServiceException;

	/**
	 * 通过ID删除终端型号
	 *
     * @param deviceModelIds 终端型号ID集(如：“1,2,3,4”)
     * @param user
     * @param request
     */
	void deleteDeviceModelBatch(String deviceModelIds, JSONObject user, HttpServletRequest request);

	/**
	 * 通过型号获取终端型号
	 *
	 * @param model 型号
	 * @return TbDeviceModel
	 */
	TbDeviceModel getDeviceModelByModel(String model);

	/**
	 * 通过ID获取终端型号
	 *
	 * @param deviceModelId 终端型号ID
	 * @return TbDeviceModel
	 */
	TbDeviceModel getDeviceModelById(Long deviceModelId);

	/**
	 * 查询指定固件中的机型
	 *
	 * @param deviceUpgradeId 固件升级ID
	 * @return List<DeviceModelDTO>
	 */
    List<DeviceModelDTO> listDeviceModelsSelectedOfFirmware(Long deviceUpgradeId);

	/**
	 * 查询指定apk升级中的机型
	 * @param deviceUpgradeId apk升级ID
	 * @return List<DeviceModelDTO>
	 */
	List<DeviceModelDTO> listDeviceModelsSelectedOfApk(Long deviceUpgradeId);
}
